require(['config'],function(){
    require(['jquery','template'],function($,template){
        const selectInfo = JSON.parse(localStorage.getItem('selectInfo'))
        const html = template('confirm-template',{selectInfo})
        $('.goods-list').append(html);
        const arrPrice = [];
        $('.goods-list').find('.goods-subTotal').each(function(){
            arrPrice.push(Number($(this).html().slice(0,4)));
        })
        const total = arrPrice.reduce((pre,cur)=>{
            return pre+=cur;
        })
        $('span.sum').html(total);
    })
})